.class public Lcom/fiberhome/xpush/ImmediateLocService;
.super Landroid/app/Service;


# instance fields
.field private a:Lcom/fiberhome/xpush/f;

.field private b:Ljava/lang/String;

.field private c:Landroid/location/LocationManager;

.field private d:Ljava/text/SimpleDateFormat;

.field private e:Lcom/fiberhome/xpush/b;

.field private f:Lcom/waiqin365/compons/c/g;

.field private g:I

.field private h:Lcom/fiberhome/xpush/f;


# direct methods
.method public constructor <init>()V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->b:Ljava/lang/String;

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->c:Landroid/location/LocationManager;

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->d:Ljava/text/SimpleDateFormat;

    const/4 v0, 0x0

    iput v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->g:I

    return-void
.end method

.method private a()V
    .locals 2

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->e:Lcom/fiberhome/xpush/b;

    if-nez v0, :cond_0

    new-instance v0, Lcom/fiberhome/xpush/b;

    invoke-direct {v0, p0}, Lcom/fiberhome/xpush/b;-><init>(Lcom/fiberhome/xpush/ImmediateLocService;)V

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->e:Lcom/fiberhome/xpush/b;

    :cond_0
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    if-nez v0, :cond_1

    new-instance v0, Lcom/waiqin365/compons/c/g;

    iget-object v1, p0, Lcom/fiberhome/xpush/ImmediateLocService;->e:Lcom/fiberhome/xpush/b;

    invoke-direct {v0, v1}, Lcom/waiqin365/compons/c/g;-><init>(Lcom/waiqin365/compons/c/l;)V

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    :cond_1
    iget v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->g:I

    rem-int/lit8 v0, v0, 0x2

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0}, Lcom/waiqin365/compons/c/g;->c()V

    :goto_0
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    const/16 v1, 0x2710

    invoke-virtual {v0, v1}, Lcom/waiqin365/compons/c/g;->a(I)V

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0, p0}, Lcom/waiqin365/compons/c/g;->a(Landroid/content/Context;)V

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0}, Lcom/waiqin365/compons/c/g;->e()V

    iget v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->g:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->g:I

    return-void

    :cond_2
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0}, Lcom/waiqin365/compons/c/g;->a()V

    goto :goto_0
.end method

.method private a(Landroid/content/Context;Lcom/fiberhome/xpush/f;)V
    .locals 4

    const/4 v3, 0x0

    invoke-static {}, Lcom/waiqin365/compons/c/a;->a()Lcom/waiqin365/compons/c/a;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/waiqin365/compons/c/a;->a(Landroid/content/Context;)Ljava/util/ArrayList;

    move-result-object v1

    if-eqz v1, :cond_0

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    const-string/jumbo v0, "cellID\u4e3a\u7a7a\u6216\u8005cellID size \u4e3a\u96f6"

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    :goto_0
    invoke-virtual {p2}, Lcom/fiberhome/xpush/f;->a()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    const-string/jumbo v0, "Accept-Language"

    const-string/jumbo v2, "zh-cn"

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "User-Agent"

    const-string/jumbo v2, "xLOC-C"

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "key"

    invoke-virtual {p2, p1}, Lcom/fiberhome/xpush/f;->a(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, "cmd"

    const-string/jumbo v2, "ACTIVELOCATION"

    invoke-virtual {v1, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string/jumbo v0, ""

    :try_start_0
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->b:Ljava/lang/String;

    invoke-virtual {p2}, Lcom/fiberhome/xpush/f;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-static {v0, v1, v2}, Lcom/waiqin365/compons/b/a;->a(Ljava/lang/String;Ljava/util/HashMap;[B)Ljava/lang/String;

    move-result-object v0

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "\u7acb\u5373\u4e0a\u4f20\u5b9a\u4f4d\u6570\u636e\u6210\u529f rsp:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/fiberhome/xpush/ImmediateLocService;->stopSelf()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    return-void

    :cond_1
    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget v0, v0, Lcom/waiqin365/compons/c/b;->a:I

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p2, Lcom/fiberhome/xpush/f;->e:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget-object v0, v0, Lcom/waiqin365/compons/c/b;->b:Ljava/lang/String;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "$"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget-object v0, v0, Lcom/waiqin365/compons/c/b;->c:Ljava/lang/String;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "$"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget v0, v0, Lcom/waiqin365/compons/c/b;->d:I

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "$"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget v0, v0, Lcom/waiqin365/compons/c/b;->f:F

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "$"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/compons/c/b;

    iget v0, v0, Lcom/waiqin365/compons/c/b;->g:F

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "$"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p2, Lcom/fiberhome/xpush/f;->f:Ljava/lang/String;

    goto/16 :goto_0

    :catch_0
    move-exception v0

    const-string/jumbo v2, "\u4e0a\u4f20\u5b9a\u4f4d\u6570\u636e\u5931\u8d25,\u91cd\u8bd5\u4e00\u6b21"

    invoke-static {v2}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    invoke-static {p0}, Lcom/fiberhome/gaea/client/d/e;->a(Landroid/content/Context;)Z

    move-result v2

    if-nez v2, :cond_2

    const-string/jumbo v2, "\u7f51\u7edc\u4e0d\u901a\uff0c\u5c1d\u8bd5\u5f3a\u5f00\u7f51\u7edc"

    invoke-static {v2}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    invoke-static {p0}, Lcom/fiberhome/gaea/client/d/e;->c(Landroid/content/Context;)V

    :cond_2
    const-wide/16 v2, 0x2710

    :try_start_1
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_1
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_1

    :goto_2
    :try_start_2
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->b:Ljava/lang/String;

    invoke-virtual {p2}, Lcom/fiberhome/xpush/f;->a()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-static {v0, v1, v2}, Lcom/waiqin365/compons/b/a;->a(Ljava/lang/String;Ljava/util/HashMap;[B)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "\u7acb\u5373\u4e0a\u4f20\u5b9a\u4f4d\u6570\u636e\u91cd\u8bd5\u6210\u529f rsp:"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2

    :goto_3
    invoke-virtual {p0}, Lcom/fiberhome/xpush/ImmediateLocService;->stopSelf()V

    goto/16 :goto_1

    :catch_1
    move-exception v2

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "\u7ebf\u7a0b\u6682\u505c10s\u629b\u5f02\u5e38 = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    goto :goto_2

    :catch_2
    move-exception v0

    const-string/jumbo v0, "\u7acb\u5373\u4e0a\u4f20\u5b9a\u4f4d\u6570\u636e\u91cd\u8bd5\u5931\u8d25"

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    goto :goto_3
.end method

.method static synthetic a(Lcom/fiberhome/xpush/ImmediateLocService;)V
    .locals 0

    invoke-direct {p0}, Lcom/fiberhome/xpush/ImmediateLocService;->b()V

    return-void
.end method

.method static synthetic a(Lcom/fiberhome/xpush/ImmediateLocService;Landroid/content/Context;Lcom/fiberhome/xpush/f;)V
    .locals 0

    invoke-direct {p0, p1, p2}, Lcom/fiberhome/xpush/ImmediateLocService;->a(Landroid/content/Context;Lcom/fiberhome/xpush/f;)V

    return-void
.end method

.method static synthetic b(Lcom/fiberhome/xpush/ImmediateLocService;)Lcom/fiberhome/xpush/f;
    .locals 1

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    return-object v0
.end method

.method private b()V
    .locals 1

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0}, Lcom/waiqin365/compons/c/g;->f()V

    :cond_0
    return-void
.end method

.method static synthetic c(Lcom/fiberhome/xpush/ImmediateLocService;)Lcom/fiberhome/xpush/f;
    .locals 1

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->h:Lcom/fiberhome/xpush/f;

    return-object v0
.end method

.method static synthetic d(Lcom/fiberhome/xpush/ImmediateLocService;)Lcom/waiqin365/compons/c/g;
    .locals 1

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    return-object v0
.end method

.method static synthetic e(Lcom/fiberhome/xpush/ImmediateLocService;)V
    .locals 0

    invoke-direct {p0}, Lcom/fiberhome/xpush/ImmediateLocService;->a()V

    return-void
.end method

.method static synthetic f(Lcom/fiberhome/xpush/ImmediateLocService;)Ljava/text/SimpleDateFormat;
    .locals 1

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->d:Ljava/text/SimpleDateFormat;

    return-object v0
.end method


# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public onCreate()V
    .locals 0

    invoke-super {p0}, Landroid/app/Service;->onCreate()V

    return-void
.end method

.method public onDestroy()V
    .locals 1

    invoke-super {p0}, Landroid/app/Service;->onDestroy()V

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->f:Lcom/waiqin365/compons/c/g;

    invoke-virtual {v0}, Lcom/waiqin365/compons/c/g;->h()V

    :cond_0
    const-string/jumbo v0, "\u7acb\u5373\u5b9a\u4f4d\u5b8c\u6210\uff0c\u7ed3\u675f\u670d\u52a1"

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    const-string/jumbo v0, "\n"

    invoke-static {v0}, Lcom/fiberhome/xpush/h;->a(Ljava/lang/String;)V

    const/4 v0, 0x0

    invoke-static {v0}, Ljava/lang/System;->exit(I)V

    return-void
.end method

.method public onStart(Landroid/content/Intent;I)V
    .locals 2

    invoke-static {p0}, Lcom/fiberhome/gaea/client/c/a;->b(Landroid/content/Context;)Ljava/lang/String;

    const-string/jumbo v0, "locinfo"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/fiberhome/xpush/f;

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->h:Lcom/fiberhome/xpush/f;

    const-string/jumbo v0, "url"

    invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->b:Ljava/lang/String;

    new-instance v0, Ljava/text/SimpleDateFormat;

    const-string/jumbo v1, "yyyy-MM-dd HH:mm:ss"

    invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->d:Ljava/text/SimpleDateFormat;

    const-string/jumbo v0, "location"

    invoke-virtual {p0, v0}, Lcom/fiberhome/xpush/ImmediateLocService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->c:Landroid/location/LocationManager;

    new-instance v0, Lcom/fiberhome/xpush/f;

    invoke-direct {v0}, Lcom/fiberhome/xpush/f;-><init>()V

    iput-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->c:Landroid/location/LocationManager;

    const-string/jumbo v1, "gps"

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    const-string/jumbo v1, "1"

    iput-object v1, v0, Lcom/fiberhome/xpush/f;->l:Ljava/lang/String;

    :goto_0
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    const-string/jumbo v1, "2"

    iput-object v1, v0, Lcom/fiberhome/xpush/f;->n:Ljava/lang/String;

    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    const-string/jumbo v1, "1"

    iput-object v1, v0, Lcom/fiberhome/xpush/f;->m:Ljava/lang/String;

    invoke-direct {p0}, Lcom/fiberhome/xpush/ImmediateLocService;->a()V

    invoke-super {p0, p1, p2}, Landroid/app/Service;->onStart(Landroid/content/Intent;I)V

    return-void

    :cond_0
    iget-object v0, p0, Lcom/fiberhome/xpush/ImmediateLocService;->a:Lcom/fiberhome/xpush/f;

    const-string/jumbo v1, "0"

    iput-object v1, v0, Lcom/fiberhome/xpush/f;->l:Ljava/lang/String;

    goto :goto_0
.end method
